package com.wtgroup.demo.mianshi.jvm.GC;

import java.util.LinkedList;
import java.util.List;

/**
 * @author dafei
 * @version 0.1
 * @date 2021/3/15 19:19
 */
public class D1_OOM {
    /**
     * java -Xms10M -Xmx10M -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintCommandLineFlags D1_OOM
     * */

    public static void main(String[] args) {
        System.out.println("HelloGC!");
        List<byte[]> list = new LinkedList<byte[]>();
        for(;;) {
            byte[] b = new byte[1024*1024]; // 1M
            list.add(b);
        }
    }

}
